home *** CD-ROM | disk | FTP | other *** search
/ Plug-In Power Pack for Netscape Communicator / Plug-In Power Pack for Netscape Communicator.iso / plugins / dataviews / dvtools / examples / windows / dv_ocx / dvocx.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-08  |  1.9 KB  |  82 lines

  1. // dvocx.cpp : Implementation of CDvocxApp and DLL registration.
  2.  
  3. #include "stdafx.h"
  4. #include "dvocx.h"
  5. #include "TFUNDECL.H"
  6.  
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12.  
  13.  
  14. CDvocxApp NEAR theApp;
  15.  
  16. const GUID CDECL BASED_CODE _tlid =
  17.         { 0xf1e0ab10, 0xa1af, 0x11cf, { 0xa7, 0x5e, 0x20, 0x4c, 0x4f, 0x4f, 0x50, 0x20 } };
  18. const WORD _wVerMajor = 1;
  19. const WORD _wVerMinor = 0;
  20.  
  21.  
  22. ////////////////////////////////////////////////////////////////////////////
  23. // CDvocxApp::InitInstance - DLL initialization
  24.  
  25. BOOL CDvocxApp::InitInstance()
  26. {
  27.     BOOL bInit = COleControlModule::InitInstance();
  28.  
  29.     if (bInit)
  30.     {
  31.         TInit(NULL, NULL);
  32.         // TODO: Add your own module initialization code here.
  33.     }
  34.  
  35.     return bInit;
  36. }
  37.  
  38.  
  39. ////////////////////////////////////////////////////////////////////////////
  40. // CDvocxApp::ExitInstance - DLL termination
  41.  
  42. int CDvocxApp::ExitInstance()
  43. {
  44.     // TODO: Add your own module termination code here.
  45.     TTerminate();
  46.     return COleControlModule::ExitInstance();
  47. }
  48.  
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. // DllRegisterServer - Adds entries to the system registry
  52.  
  53. STDAPI DllRegisterServer(void)
  54. {
  55.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  56.  
  57.     if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
  58.         return ResultFromScode(SELFREG_E_TYPELIB);
  59.  
  60.     if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
  61.         return ResultFromScode(SELFREG_E_CLASS);
  62.  
  63.     return NOERROR;
  64. }
  65.  
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68. // DllUnregisterServer - Removes entries from the system registry
  69.  
  70. STDAPI DllUnregisterServer(void)
  71. {
  72.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  73.  
  74.     if (!AfxOleUnregisterTypeLib(_tlid))
  75.         return ResultFromScode(SELFREG_E_TYPELIB);
  76.  
  77.     if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
  78.         return ResultFromScode(SELFREG_E_CLASS);
  79.  
  80.     return NOERROR;
  81. }
  82.